import React from "react";
import { Link, useRoutes } from "react-router-dom";

import routes from "./routes"

export default function App() {
  // 根据路由表生成路由规则
  const element = useRoutes(routes);
  return (
    <>
      <nav>
        <h2>菜单</h2>
        <ul>
          <li>
            <Link to="/about">About</Link>
          </li>
          <li>
            <Link to="/home">Home</Link>
          </li>
        </ul>
      </nav>
      <hr />
      {element}
    </>
  );
}
